home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_333 / multiplot / source / mplot_src / ffp.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  595b  |  30 lines

  1. /* ffp.h */
  2.  
  3. #define FFP_H 1
  4. #include <float.h>
  5. #include <math.h>
  6.  
  7. typedef double FFP;
  8. extern double atof(char *);
  9. #define atoFFP(x) (FFP)atof(x)
  10.  
  11. #ifdef MAIN_MODULE
  12. FFP FFPLARGE = 1.0e10, FFPSMALL = 1.0e-10;
  13. #else
  14. extern FFP FFPLARGE, FFPSMALL;
  15. #endif
  16.  
  17. #ifndef max
  18. #define max(a,b) (((a)>(b)) ? (a) : (b))
  19. #define min(a,b) (((a)>(b)) ? (b) : (a))
  20. #endif
  21.  
  22. #define NINT(a)  ((int)((a)>=0 ? (a)+0.5 : (a)-0.5))
  23.  
  24. /* a AND b DIFFER BY LESS THAN DEFAULT TOLERANCE ? */
  25. #define FFPSAME(a,b) (abs((a)-(b)) <= FFPSMALL)
  26.  
  27. /* a AND b DIFFER BY LESS THAN c */
  28. #define FFPNEAR(a,b,c) (abs((a)-(b)) <= (c))
  29.  
  30.